<?php
use common\helps\tools;
?>
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.theme.default.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<style>
.ul_tree_display {
	display: none;
}

.tr_tree_display {
	display: none;
}

.table>tbody>tr>td {
	vertical-align: middle;
	font-size: 0.8em;
}

.layui-layer-content p {
	padding: 15px;
}

.dataTables_length {
	margin-top: 10px;
}
</style>
<div class="tabs-panel">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-body">
					<table id="table_list" class="table table-bordered table-hover">
						<thead>
							<tr>
								<th style="width:15%">楼层</th>
								<th style="width:15%">分类</th>
								<th style="width:55%">分类内容</th>
								<th style="width:15%">操作</th>
							</tr>
						</thead>
						<tbody>
							<?php 
							if (is_array($GLOBALS['SHOPPING_MALL_FLOOR']) && count($GLOBALS['SHOPPING_MALL_FLOOR']) > 0)foreach ($GLOBALS['SHOPPING_MALL_FLOOR'] as $floor_num=>$floor_val){
							    $floor_data = tools::arrayHasValue($floor_category,$floor_num) ? $floor_category[$floor_num] : [];
							?>
							<tr>
								<td rowspan="2"><?=$floor_val?></td>
								<td>一级分类</td>
								<td><input name="content"  style="width:100%;height:20px;height:30px;" class="form-control" type="text" value="<?=(tools::arrayHasValue($floor_data,1) ? $floor_data[1]['content'] : '')?>"></td>
								<td><a href="javascript:" onclick="operFloorCategory(<?=$floor_num?>,1,<?=(tools::arrayHasValue($floor_data,1) ? $floor_data[1]['id'] : '0')?>,$(this))">保存</a></td>
							</tr>
							<tr>
								<td>二级分类</td>
								<td><input name="content"  style="width:100%;height:20px;height:30px;" class="form-control" type="text" value="<?=(tools::arrayHasValue($floor_data,2) ? $floor_data[2]['content'] : '')?>"></td>
								<td><a href="javascript:" onclick="operFloorCategory(<?=$floor_num?>,2,<?=(tools::arrayHasValue($floor_data,2) ? $floor_data[2]['id'] : '0')?>,$(this))">保存</a></td>
							</tr>
							<?php }?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 固定js -->
<script type="text/javascript" src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="/static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="/static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="/static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="/static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="/static/app/shopping-mall/floor-category.js?version=<?=Yii::$app->params['version']?>"></script>